
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/10 16:58
 */

#include "iostream"
#include "cstring"
#include "algorithm"

using namespace std;

int main() {
    int const N = 1000;
    int n;
    cin >> n;
    int pos[N + 1];
    int neg[N + 1];
    for (int i = 0; i <= N; ++i) {
        pos[i] = 0;
        neg[i] = 0;
    }

    int res = 0;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        if (x > 0) {
            pos[x] = 1;
            if (neg[x]) {
                res++;
            }
        } else if (x < 0) {
            x = -x;
            neg[x] = 1;
            if (pos[x]) {
                res++;
            }
        }
    }

    cout << res;

    return 0;
}